var xmlHttp;
function ConvertFunction (str)
{
    try
    {
        xmlHttp = new ActiveXObject ("Msxml2.XMLHTTP");
    }
    catch (e)
    {
        try
        {
            xmlHttp = new ActiveXObject ("Microsoft.XMLHTTP");
        }
        catch (e)
        {
            alert ("Your browser does not support AJAX!");
            return false;
        }
    }
    xmlHttp.onreadystatechange = StateChanged;
    if (window.event.keyCode == 8)
    {
        //window.history.back();
    }
    var url = "ConvertTo.jsp";
    url = url + "?red=" + document.myForm.red.value + "&green=" + document.myForm.green.value + "&blue=" + document.myForm.blue.value + "";
    xmlHttp.open ("GET", url, true);
    xmlHttp.send (null);
}

function StateChanged ()
{
    if (xmlHttp.readyState == 4)
    {
        document.getElementById ('vb').style.backgroundColor = "rgb(" + xmlHttp.responseText + ")";
    }
}
